<ul class="breadcrumb">
	<li><a href="/admin">Dashboard</a><span class="divider">&raquo;</span></li>
	<li class="active">Manager Bill</li>
</ul>

<div class="row-fluid">
	<div class="span12">
		<div class="nonboxy-widget">
			<div class="widget-head">
				<h5 style="display: inline;">List Bills

				</h5>
				<a clas="add-new" style="float:right; margin-top:10px" href="/admin/bills/add"><i class="color-icons add_co"></i>Add New Bill</a>
			</div>

			<?php echo $this->Session->flash(); ?>

			<table class="data-tbl-simple table table-bordered">
			<thead>
				<tr>
					<th> # </th>
					<th> Employee</th>
					<th> Customer </th>
					<th> Created date </th>
					<th> Sum(VNĐ)</th>
					<th> Deposit(VNĐ)</th>
					<th> Discount</th>
					<th> Remaining(VNĐ)</th>
					<th style="width:50px;"></th>
				</tr>
				</thead>

				<tbody>
				<?php if(!empty($bills)) foreach($bills as $item): ?>
					<tr>
						<td> <a href="#"><?php echo $item[$als]['id']?></a> </td>

						<td><?php echo $employees[$item[$als]['employee']]?></td>

						<td><?php echo $item[$als]['name_from']?></td>

						<td><?php echo  date("d/m/Y", strtotime( $item[$als]['created'] ) );?></td>

						<td><?php $sum = $item[$als]['sum']; echo number_format($item[$als]['sum'], 0, ',', '.' )?></td>

						<td><?php echo number_format($item[$als]['get_payment'], 0, ',', '.' )?></td>

						<td>
							<?php $discount = ($sum * $item[$als]['discount'])/100?>
							<?php echo $item[$als]['discount'].'%('. number_format($discount, 0, ',', '.' ). ')'; ?>
						</td>

						<td><?php echo number_format($item[$als]['remaining'], 0, ',', '.' )?></td>

						<td>
						<?php if(isset($isDelete) && $isDelete):?>
							<a href="/admin/bills/changeStatus/<?php echo $item[$als]['id']?>/9" onclick="return confirmChangeStatus($(this), 'Are you sure delete product?', 'Ok')" class="btn btn-mini btn-danger">
								<i class="icon-trash icon-white"></i> Delete
							</a>
						<?php endif;?>
						</td>
					</tr>
				<?php  endforeach;?>
				</tbody>
			</table>
		</div>
	</div>
</div>

